﻿using System.ComponentModel.DataAnnotations;

namespace Md.Api.Model.Manage.SysDept.Request;
/// <summary>
/// 添加系统部门请求实体
/// </summary>
public class RequestInsertSysDeptModel : RequestBaseModel
{
    /// <summary>
    /// 父部门id
    /// </summary>
    public long ParentId { get; set; }
    /// <summary>
    /// 祖级列表
    /// </summary>
    public string? Ancestors { get; set; }
    /// <summary>
    /// 部门名称
    /// </summary>
    [Required(ErrorMessage = "部门名称不能为空")]
    public string? DeptName { get; set; }
    /// <summary>
    /// 显示顺序
    /// </summary>
    public int OrderNum { get; set; }
    /// <summary>
    /// 负责人
    /// </summary>
    public string? Leader { get; set; }
    /// <summary>
    /// 联系电话
    /// </summary>
    [StringLength(11, ErrorMessage = "联系电话长度为11")]
    public string? Phone { get; set; }
    /// <summary>
    /// 邮箱
    /// </summary>
    [RegularExpression(@"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", ErrorMessage = "邮箱格式不正确")]
    public string? Email { get; set; }
    /// <summary>
    /// 部门状态（0正常 1停用）
    /// </summary>
    [Required(ErrorMessage = "部门状态为空"), StringLength(1, ErrorMessage = "部门状态长度为1")]
    public string? Status { get; set; }
}

